import { reactive, watch } from 'vue';

export default function importConfig(props, emits) {
  const { emit } = emits;
  const base = reactive<any>({
    value: null,
  });
  /**
   * @export getInput 双向绑定数据
   * @param param
   */
  const getInput = (param) => {
    console.log(param, '==>getInput');
    emit('onUpdate', param);
  };

  // const onUpdate = (param) => {
  //     return param
  // }

  watch(
    () => props.vmValue,
    (steam) => {
      base.value = steam;
    },
    {
      immediate: true,
    },
  );
  return {
    base,
    getInput,
    // onUpdate
  };
}
